#include <stdio.h>
#include <stdlib.h>
int ok(int n) {
	int a = n / 100, b = n % 10, c = (n % 100) / 10;
	return a * a * a + b * b * b + c * c * c == n;
}
int main(void) {
	int n;
	while (1 == scanf("%d", &n) && n != 0)
		puts(ok(n) ? "Yes" : "No");
	return EXIT_SUCCESS;
}
